cat /etc/shells

echo $SHELL

echo $0 # current .sh file

date

is_prime() {
  local num=$1 # not let num as global, then use local

  if [ $num -lt 2 ]; then 
      return 1
  fi

  for ((i=2; i*i<=num;i++)); do
    if [ $((num % i)) -eq 0 ]; then
      return 1
    fi
  done

  return 0
}

main() {
read -p "input a integer num(>1): " number

if is_prime $number; then
  echo "$number is primer"
else
  echo "$number not primer"
fi
}
# $# $? $* $@ $$ $! $0 $1-n
main "$@"

guess_game() {
  # local name=$1
  # local channel=$2
  local to_guess=$(shuf -i 1-10 -n 1)
  # echo $to_guess

  # while [[ $to_guess -ne $num ]]
  while true
  do
    read -p "type in a integer num(1-10): " num
    if [[ $num -eq $to_guess ]]; then
      echo "fucking right, want to go on? [y/n]: "
      read choice
      if [[ $choice="y" ]]; then
        continue
      else
        break
      fi
    else 
      echo "Damn it"
    fi
  done
}

guess_game $@
